﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using St0rm.IRCPro.Client;

namespace St0rm.IRCPro.Common {
    /// <summary>
    /// Used to log events
    /// </summary>
    class Log {
        /// <summary>
        /// Logs errors
        /// </summary>
        /// <param name="client">Client with error</param>
        /// <param name="error">Error to log</param>
        public static void Error(Client.Client client, string error) {
            if (client.Verbose) {
                ConsoleColor c = Console.ForegroundColor;
                Console.ForegroundColor = ConsoleColor.Red;
                Console.WriteLine(error);
                Console.ForegroundColor = c;
            }
        }
        /// <summary>
        /// Logs errors
        /// </summary>
        /// <param name="client">Client with error</param>
        /// <param name="error">Error to log</param>
        /// <param name="format">Format items</param>
        public static void Error(Client.Client client, string error, params object[] format) {
            Error(client, String.Format(error, format));
        }
    }
}
